Correcting distortion in an imaging system using parametric motion estimation

ABSTRACT

Distortion correction in an imaging system using parametric motion estimation. Parametric motion estimation is used to correct for geometric lens distortion and illumination changes. Models for geometric lens distortion and different illumination models are presented, as is a method for an iterative linearising method of solving the resulting sets of nonlinear equations.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention deals with the correction of distortion in imaging systems, more particularly to systems such as scanners and in cameras used in applications such as image capture and video conferencing.

2. Art Background

With the advent of inexpensive imaging sensors, applications such as video conferencing and remote image capture are becoming more prevalent. As manufacturers provide imaging systems at lower and lower price points, compromises are made especially in the optics provided, leading to systems having geometric lens distortion. As these systems are placed in more locations, problems with illumination arise, both as a result of variations in lighting conditions, as well as the effect of automatic brightness controls in the imaging systems themselves.

The field of motion estimation deals with processing images for example to stitch together successive overlapping images to form a unified mosaic. These motion estimation techniques deal with arrays of pixels, and operate by deriving the motion between a group of pixels in one frame and the same pixels in a new position in a second frame. For motion estimation to succeed, the illumination levels and therefore pixel intensity between the two frames must be the same, and the frames must be relatively free of geometric distortion. What is needed is a way to correct for the effects of geometric lens distortion in motion estimation, and to correct for changes in illumination that effect pixel density.

SUMMARY OF THE INVENTION

Motion estimation techniques and the Optical Flow Equation (OFE) are applied to correct for distortion in an imaging system. Geometric lens distortion is corrected using a novel optical correction model. Illumination changes are corrected using both simple and Vignetting models. The solutions involve solving of a set of nonlinear equations. Typical solutions to these equations are computationally expensive. An iterative linearising solution is presented.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is described with respect to particular exemplary embodiments thereof and reference is made to the drawings in which:

FIG. 1 is a block diagram of an imaging system,

FIG. 2 is a diagram showing geometric lens distortion, and

FIG. 3 is a flowchart of the linearized solution.

DETAILED DESCRIPTION

Inexpensive imaging sensors are enabling more applications of imaging technologies, such as video conferencing and image scanning. Compromises in sensor design, and in sensor placement lead to distortions in the resulting images.

Motion estimation techniques deal with processing images for example to stitch together successive overlapping images to form a unified mosaic; this technique us used for example in assembling scanned images of a large area using multiple passes of an imaging sensor. Motion estimation allows the overlaps to be recognized and the smaller images from each pass stitched together to form the larger unified mosaic. Similar techniques also arise in videoconferencing when the videoconferencing camera is moved, or a videoconferencing camera is used to scan a document.

To succeed, motion estimation presupposes the illumination and therefore pixel densities of overlapping image portions to be the same, and that the images are free from geometric distortion. Inexpensive optics introduce geometric distortion, and may also introduce illumination differences such as vignetting, the gradual fall off of illumination or image density away from the central axis of the image sensor. Additional illumination distortions are introduced by automatic brightness controls in image sensors, and by poor or uneven illumination in the environment.

Two dimensional motion estimation refers to determining the displacements or velocities of pixels from one frame to another. The motion is induced as the same physical point on the surface of an object in 3-D space is mapped to different locations within the imaging plane at different time. In the sampled image domain this results in different pixel indices. This difference in pixel indices taken relative to one of the frames is called the “motion vector” at that pixel between those two frames. Each pixel in the image has a motion vector of dimension two representing horizontal and vertical displacements. The collection of all motion vectors is sometimes called the “motion vector field”, or simply “motion field”. The term “field” should be understood in a broader sense, not in strict mathematical definition of “vector field”. Motion estimation from sequences of images is discussed for example in A. M. Tekalp, Digital Video Processing, Prentice Hall Signal Processing Series; M. I. Sezan and R. L. Lagendijk, Motion Analysis and Image Sequence Processing, Norwell, Mass.: Kluwer, 1993; and J. K. Aggarwal and N. Nandhakumar, “On the computation of motion from sequences of images- A review,” Proc. IEEE, vol. 76, pp. 917-935, August 1988.

FIG. 1 shows a system for performing motion estimation. Bus 100 interconnects image capture device 110 with central processing unit (CPU) 120. Memory hierarchy 130 provides storage for instructions and data, including storage of frames if data from information capture device 110, typically containing a mixture of RAM, ROM, and permanent disc storage. Not shown are other typical items such as displays and network connections. Image capture device 110 may be a device such as a television camera with appropriate frame capture hardware, or other imaging device such as a teleconferencing camera, CCD image sensor, scanner, or the like.

Optical Flow

In principle, all pixels within an image can be thought to follow a given trajectory through time. The trajectory of a given pixel can be parameterized via time, given an initial position at some reference time. If we take the reference time as t=t₁, then

c(t;x,y,t ₁)=(x(t;x,y,t ₁),y(t;x,y,t ₁),t),

where c denotes the trajectory followed by a pixel originating at (x,y,t₁). For the development that follows, we abbreviate x(t;x,y,t₁) as x(t), and apply similar abbreviations for y(t) and c(t). Even though physical conditions generally limit the variation between trajectories of neighboring pixels, conditions such as occlusion and uncovered background can lead to arbitrary (independent) trajectories amongst neighboring pixels. In this treatment we neglect occlusion and uncovered background.

Assuming further the intensity/color value of a pixel does not change with time along the motion trajectory, then, with I(x,y,t) denoting the intensity function, $\begin{matrix} {\frac{{I\left( {c(t)} \right)}}{t} = 0.} & (1) \end{matrix}$

Using the chain rule of vector calculus, Equation (1) can be written as $\begin{matrix} {\frac{{I\left( {c(t)} \right)}}{t} = {{{\frac{\partial{I\left( {x,y,t} \right)}}{\partial x}\frac{{x(t)}}{t}} + {\frac{\partial{I\left( {x,y,t} \right)}}{\partial y}\frac{{y(t)}}{t}} + {\frac{\partial{I\left( {x,y,t} \right)}}{\partial t}\frac{t}{t}}} = 0.}} & (2) \end{matrix}$

Letting $\begin{matrix} {{{I_{x}\left( {x,y,t} \right)} = \frac{\partial{I\left( {x,y,t} \right)}}{\partial x}}{{I_{y}\left( {x,y,t} \right)} = \frac{\partial{I\left( {x,y,t} \right)}}{\partial y}}{{I_{t}\left( {x,y,t} \right)} = \frac{\partial{I\left( {x,y,t} \right)}}{\partial t}}} & (3) \end{matrix}$

results in

I _(x)(x,y,t)x′(t)+I _(y)(x,y,t)y′(t)+I _(t)(x,y,t)=0,  (4)

where I_(x) and I_(y) are the spatial image gradients, I_(t) is the temporal image gradient, and where x′ and y′ are the horizontal and vertical velocity components respectively. Equation (4) is called the optic-flow-equation (OFE), sometimes abbreviated as:

I _(x) x′+I _(y) y′+I _(t)=0.  (5)

We can proceed using (4) in two equivalent ways. In the first approach integrate both sides of (4) from t₁ to t₂with respect to t, and assume both I_(x)(x,y,t) and I_(y)(x,y,t) are constant with respect to time to obtain:

I _(x)(x,y,t)(x(t₂)−x(t ₁))+I _(y)(x,y,t)(y(t ₂)−y(t ₁))+(I(x,y,t ₂)−I(x,y,t ₁))=0.  (6)

For convenience, define:

I ₂(x,y)=I(x,y,t ₂), I ₁(x,y)=I(x,y,t ₁), I ₂₁(x,y)=I ₂(x,y)−I ₁(x,y)  (7)

and

u(x,y)=x(t ₂)−x(t ₁), v(x,y)=y(t ₂)−y(t ₁),  (8)

to obtain

I _(x)(x,y)u(x,y)+I _(y)(x,y)v(x,y)+I ₂₁(x,y)=0.  (9)

As a result of assuming I_(x) and I_(y) are constant with respect to time between t₁ and t₂, we drop time dependence from the notation. Second, this assumption taken together with the continuity of intensity assumption and (1) implies that I_(t) (x,y,t) is constant between t₁ and t₂. This allows for trivial integration of I_(t) (x,y,t) on this interval. Lastly, estimates of I_(x) and I_(y) can be obtained anywhere on [t₁,t₂]. This is important to note because if we begin with just two frames at t₁ and t₂, we can discretely estimate I_(x) and I_(y) using either frame.

The second method of proceeding from (5) is to approximate the derivatives involved by first order differences and then multiply through by (t₂−t₁). Then, once again, if we have just two frames at t₁ and t₂, we can discretely estimate I_(x) and I_(y) using either frame, and the interpretation of this amounts to whether we employ a forward or backward approximation to estimate the derivatives.

In the development to this point it has been assumed that there is an explicit temporal evolution of the image intensity distribution. To enforce this assumption the chain rule has been applied to the intensity distribution temporal derivative. We can equivalently, however, begin from a completely discrete perspective and proceed instead by applying a 2-D spatial Taylor series approximation. To that end, assume from the onset that we have two captured frames at times t₁ and t₂. Now, the notion of intensity invariance is expressed as (ignoring illumination change effects):

I ₁(x ₁ ,y ₂)=I ₂(x ₂ ,I _(y) ₂),  (10)

where I₁ (x₁,y₁) refers to the image intensity at the pixel (x₁,y₁) in the first frame captured at time t₁, and I₂ (x₂,y₂) refers to the intensity at the point (x₂,y₂) in the second frame captured at time t₂. Note that (x₁,y₁) are integer valued, but (x₂,y₂) are real-valued. Both I₁ and I₂ are assumed to be continuous and differentiable functions with respect to x and y. Using the definition of motion vectors, one can write

x ₂ =x ₁ +u(x ₁ ,y ₁)

y ₂ =y ₁ +v(x ₁ ,y ₁)  (11)

where u(.,.) and v(.,.) are the horizontal and vertical motion vectors, respectively. Combining Equations (10) and (11), and using a Taylor Series Expansion of differentiable functions,

I ₁(x ₁ , y ₁)=I ₂(x ₁ +u(x ₁ , y ₁), y _(1+v)(x ₁ , y ₁))

$\begin{matrix} \begin{matrix} {{I_{1}\left( {x_{1},y_{1}} \right)} = \quad {I_{2}\left( {{x_{1} + {u\left( {x_{1},y_{1}} \right)}},{y_{1} + {v\left( {x_{1},y_{1}} \right)}}} \right)}} \\ {= \quad {{I_{2}\left( {x_{1},y_{1}} \right)} + {\frac{\partial{I_{2}\left( {x,y} \right)}}{\partial x}{_{x_{1},y_{1}}{{u\left( {x_{1},y_{1}} \right)} + \frac{\partial{I_{2}\left( {x,y} \right)}}{\partial y}}}_{x_{1},y_{1}}{v\left( {x_{1},y_{1}} \right)}} + {h.o.t}}} \end{matrix} & (12) \end{matrix}$

The Taylor series is expanded around the pixel (x₁,y₁). Assuming either that u(x₁,y₁) and v(x₁,y₁) are small quantities or that the higher order terms are all zero, we can disregard the higher order terms in Equation (12), and arrive at $\begin{matrix} {{{\frac{\partial{I_{2}\left( {x,y} \right)}}{\partial x}{_{x_{1},y_{1}}{{u\left( {x_{1},y_{1}} \right)} + \frac{\partial{I_{2}\left( {x,y} \right)}}{\partial y}}}_{x_{1},y_{1}}{v\left( {x_{1},y_{1}} \right)}} + \left( {{I_{2}\left( {x_{1},y_{1}} \right)} - {I_{1}\left( {x_{1},y_{1}} \right)}} \right)} \cong 0.} & (13) \end{matrix}$

Note that by employing the same notation as in the previous development we write

I _(x)(x,y)u(x,y)+I _(y)(x,y)v(x,y)+I ₂₁(x,y)=0,  (14)

which is the same result (9) previously arrived at.

Parametric Motion Models

In many realistic imaging scenarios a 2-D motion field is induced by either camera motion or objects in the 3-D world undergoing a rigid motion. Each of these effects produces a smoothly varying 2-D motion field (provided that the depth of the objects does not change swiftly in proportion to its distance to imaging device). Noting the fact that the motion field is smoothly varying, there have been attempts to describe it using a parametric model. Namely,the motion vector at any pixel needs to obey a model characterized by a few parameters. Therefore, the motion vector of a pixel is completely represented by the model parameters and its location.

Given a vector of model parameters a the motion is expressed as u(x,y)=f(x,y;a) and v(x,y)=g(x,y;a). In order to estimate the model parameters we define the following cost function, $\begin{matrix} {\Psi = {\sum\limits_{x,{y \in I}}{\left\{ \left( {{I_{x}u} + {I_{y}v} + I_{21}} \right)^{2} \right\}.}}} & (15) \end{matrix}$

The parameter estimation procedure is to take derivatives of ψ with respect to each element of a, set those derivatives to zero, then solve the resulting set of equations. For non-linear models f and g a linearization step is typically employed.

In the following, we will examine the parametric motion models: 1) translational motion, 2) affine motion, 3) bilinear motion, and 4) perspective motion. These parametric motion models can be shown to be the projection of the motion of simple 3-D objects, such as a plane, under different projection models onto the 2-D imaging plane. Lastly, (15) is extended to include a-priori information and apply the result to estimate constrained global translational motion.

Translational Motion Estimation

One of the simplest models that can be imposed on the motion vector field is that all the motion vectors be the same, i.e. every pixel in the image is moving in the same direction by the same amount. This motion model is usually called “global translational motion”. However, it should be noted that translational motion does not necessarily mean that objects in the 3-D (real) world translate. 3-D translational motion could only be reduced to a 2-D translational model under the assumption that the 3-D object is a planar object, and an orthographic camera model is utilized. Additionally, global translational motion can be induced by a camera translation while a “distant” scene is being imaged. It may sound a very restrictive motion model, however there are applications to which this model perfectly fits. An example is multi-frame resolution enhancement technologies for scanner applications, where multiple scans of a flat page are taken such that a translational shift occurs between each scan.

The motion model constraints for this case are

u(x,y)=u _(g) v(x,y)=v _(g)  (16)

where u_(g) and v_(g) refer to global horizontal and vertical displacements. Then, taking the derivatives of (15)with respect to u and v, and setting them equal to zero yields $\begin{matrix} {{\frac{\partial\Psi}{\partial u} = {{\sum\limits_{x,{y \in I}}{2\left( {{I_{x}u_{g}} + {I_{y}v_{g}} + I_{21}} \right)I_{x}}} = 0}}{\frac{\partial\Psi}{\partial v} = {{\sum\limits_{x,{y \in I}}{2\left( {{I_{x}u_{g}} + {I_{y}v_{g}} + I_{21}} \right)I_{y}}} = 0}}} & (17) \end{matrix}$

Equation (17) can be re-written in the matrix form as follows: $\begin{matrix} {{\begin{bmatrix} {\sum\limits_{x,{y \in I}}I_{x}^{2}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}I_{y}^{2}} \end{bmatrix}\begin{bmatrix} u_{g} \\ v_{g} \end{bmatrix}} = \begin{bmatrix} {- {\sum\limits_{x,{y \in I}}{I_{x}I_{21}}}} \\ {- {\sum\limits_{x,{y \in I}}{I_{y}I_{21}}}} \end{bmatrix}} & (18) \end{matrix}$

Equation (18) can be solved to estimate global displacement parameters.

Affine Motion

Affine motion is another commonly employed motion model. It can account for 2-D transformations such as global rotation, translation, zoom and skew. Physically, affine motion is generated between two images when the 3-D scene is planar and two images are acquired using different imaging plane positions under the orthogonal projection. The affine motion model is described by

u(x,y)=a ₁ x+a ₂ y+a ₃

i v(x,y)=a ₄ x+a ₅ y+a ₆  (19)

where a₁,a₂,a₃,a₄,a₅,a₆ are model parameters (sometimes called “Affine Parameters”) and (x,y) is the pixel location. Note that global translational motion results when a₁, a₂, a₄ and a₅ are all zero.

To solve for optimal affine parameters in the Least Square sense, we expand (15) as $\Psi = {\sum\limits_{x,{y \in I}}\left\{ {{{I_{x}\left( {x,y} \right)}\left( {{xa}_{1} + {ya}_{2} + a_{3}} \right)} + {{I_{y}\left( {x,y} \right)}\left( {{xa}_{4} + {ya}_{5} + a_{6}} \right)} + {I_{21}\left( {x,y} \right)}} \right\}^{2}}$

As previously mentioned, ψ is minimized by taking the derivatives with respect to the affine parameters a₁,a₂,a₃,a₄,a₅,a₆, and setting each derivative equal to zero. After carrying out the algebra, one can arrive at the following linear matrix equation. ${\begin{bmatrix} {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{y}}} \end{bmatrix}\begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} a_{1} \\ a_{2} \end{matrix} \\ a_{3} \end{matrix} \\ a_{4} \end{matrix} \\ a_{5} \end{matrix} \\ a_{6} \end{bmatrix}} = \begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {- {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{21}}}} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{x}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{y}I_{21}}}} \end{bmatrix}$

Bilinear Motion

The global bilinear transform is used to improve on the capabilities of the affine transform, yet still yield a linear estimation problem. In the case of an affine transformation parallel lines always remain parallel. This is not the case for motion induced by a perspective-projection imaging model. The perspective model, however, which will be treated next, yields a non-linear problem. The bilinear transform can be a good compromise in that it transforms horizontal and vertical straight lines into straight lines, but does not produce parallel lines for any given parallel pair lines. The potential problem in using a bilinear transform is that lines that are not horizontal or vertical will be transformed to have some degree of curvature. If the curvature becomes severe the transform may not be representative of the actual motion and imaging system.

The derivation of global bilinear motion model estimation is quite similar to affine motion model estimation. In particular, the motion field is governed by:

u(x,y)=a₁ +a ₂ x+a ₃ y+a ₄ xy

v(x,y)=a ₅ +a ₆ x+a ₇ y+a ₈ xy  (20)

By substituting (20) into (15) and setting the derivatives with respect to model parameters equal to zero, we obtain, ${\begin{bmatrix} {\sum\limits_{x,{y \in I}}{I_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}I_{x}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}{xI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}{yI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xyI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}{xyI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}I_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}{xI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xyI}_{y}{yI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{I_{x}{xyI}_{y}}} & {\sum\limits_{x,{y \in I}}{xI}_{x}} & {\sum\limits_{x,{y \in I}}{yI}_{x}} & {\sum\limits_{x,{y \in I}}{xyI}_{x}} & {\sum\limits_{x,{y \in I}}I_{y}} & {\sum\limits_{x,{y \in I}}{xI}_{y}} & {\sum\limits_{x,{y \in I}}{yI}_{y}} & {\sum\limits_{x,{y \in I}}{xyI}_{y}} \end{bmatrix}\begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} a_{1} \\ a_{2} \end{matrix} \\ a_{3} \end{matrix} \\ a_{4} \end{matrix} \\ a_{5} \end{matrix} \\ a_{6} \end{matrix} \\ a_{7} \end{matrix} \\ a_{8} \end{bmatrix}} = \begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {\sum\limits_{x,{y \in I}}I_{x}} \\ \sum\limits_{x,{y \in I}} \end{matrix} \\ {\sum\limits_{x,{y \in I}}{yI}_{x}} \end{matrix} \\ {\sum\limits_{x,{y \in I}}{xyI}_{x}} \end{matrix} \\ \sum\limits_{x,{y \in I}} \end{matrix} \\ \sum\limits_{x,{y \in I}} \end{matrix} \\ {\sum\limits_{x,{y \in I}}{yI}_{y}} \end{matrix} \\ \sum\limits_{x,{y \in I}} \end{bmatrix}$

Perspective Motion

The perspective motion model is the most versatile of the motion models used thus far. Physically,the perspective model takes into account the 2-D mapping induced among perspective projected images of a plane in 3-D under different focal plane positions. A complication is that the perspective model is nonlinear in its model parameters.

The motion field in global perspective model is governed by the following equations. $\begin{matrix} {{{u\left( {x,y} \right)} = {\frac{{a_{1}x} + {a_{2}y} + a_{3}}{{a_{7}x} + {a_{8}y} + 1} - x}}{{v\left( {x,y} \right)} = {\frac{{a_{4}x} + {a_{5}y} + a_{6}}{{a_{7}x} + {a_{8}y} + 1} - y}}} & (21) \end{matrix}$

Before using these model parameters in (15) they are first linearized around the default perspective parameter a=(1,0,0,0,1,0,0,0) to yield

u(x,y)≅(a ₁−1)x+a ₂ y+a ₃ −a ₇ x ² −a ₈ xy

v(x,y)≅a ₄ x+(a ₅−1)y+a ₆ −a ₇

xy−a₈ y ²  (22)

To solve for optimal perspective motion model parameters in the Least Square sense, we apply (22) to (15) and obtain $\Psi = {\sum\limits_{x,{y \in I}}\begin{Bmatrix} {{{I_{x}\left( {x,y} \right)}\left( {{\left( {a_{1} - 1} \right)x} + {a_{2}y} + a_{3} - {a_{7}x^{2}} - {a_{8}{xy}}} \right)} +} \\ {{{I_{y}\left( {x,y} \right)}\left( {{a_{4}x} + {\left( {a_{5} - 1} \right)y} + a_{6} - {a_{7}{xy}} - {a_{8}y^{2}}} \right)} + {I_{21}\left( {x,y} \right)}} \end{Bmatrix}^{2}}$

To minimize Ψ, we take the derivatives of Ψ with respect to perspective parameters a₁, a₂, a₃, a₄, a₅, a₆, a₇, and a₈ and set them equal to zero. After carrying out the algebra, one can arrive at the following linear matrix equation. $\begin{matrix} {{\begin{bmatrix} {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{\eta \quad {xI}_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {xI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{\eta \quad {yI}_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {yI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{\eta \quad I_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad I_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{\eta \quad {xI}_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {xI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{\eta \quad {yI}_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {yI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{\eta \quad I_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}\eta}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}\eta}} & {\sum\limits_{x,{y \in I}}{I_{x}\eta}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}\eta}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}\eta}} & {\sum\limits_{x,{y \in I}}{I_{y}\eta}} & {\sum\limits_{x,{y \in I}}{\eta\eta}} & {\sum\limits_{x,{y \in I}}{\mu\eta}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}\mu}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}\mu}} & {\sum\limits_{x,{y \in I}}{I_{x}\mu}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}\mu}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}\mu}} & {\sum\limits_{x,{y \in I}}{I_{y}\mu}} & {\sum\limits_{x,{y \in I}}{\eta\mu}} & {\sum\limits_{x,{y \in I}}{\mu\mu}} \end{bmatrix}\begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {a_{1} - 1} \\ a_{2} \end{matrix} \\ a_{3} \end{matrix} \\ a_{4} \end{matrix} \\ {a_{5} - 1} \end{matrix} \\ a_{6} \end{matrix} \\ a_{7} \end{matrix} \\ a_{8} \end{bmatrix}} = \begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {- {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{t}}}} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{x}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{y}I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{\eta \quad I_{21}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{\mu \quad I_{21}}}} \end{bmatrix}} & (23) \end{matrix}$

where

η=x ² I _(x) +xyI _(y)

μ=xyI _(x) +y ² I _(y)

Note that we have utilized the Taylor Series Approximation twice, in contrast to all previous derivations. Until this point, only linearization of the intensity function has been required. However, we had to additionally linearize the motion model to derive the Linear Matrix Equation form of Equation (23). Due to this added linearization step, perspective parameter estimation can be less accurate and stable.

In some applications, one may have a-priori information relating to the motion model parameters. Such information, for instance, could be a probability distribution of the model parameters. We take this additional information into account by modifying the cost function (15) such that $\begin{matrix} {\Psi = {\sum\limits_{x,{y \in I}}\left\{ {\left( {{I_{x}u} + {I_{y}v} + I_{t}} \right)^{2} + {\phi \left( {u,v} \right)}} \right\}}} & (24) \end{matrix}$

Where the a-priori information is embodied using φ(u,v).

We will only derive the equations to estimate the global translational motion model parameters under such constraints. In this case we proceed as before and obtain $\begin{matrix} {{\frac{\partial\Psi}{\partial u} = {{\sum\limits_{x,{y \in I}}\left\{ {{2\left( {{I_{x}u_{g}} + {I_{y}v_{g}} + I_{21}} \right)I_{x}} + \frac{\partial\phi}{\partial u}} \right\}} = 0}}{\frac{\partial\Psi}{\partial v} = {{\sum\limits_{x,{y \in I}}\left\{ {{2\left( {{I_{x}u_{g}} + {I_{y}v_{g}} + I_{21}} \right)I_{y}} + \frac{\partial\phi}{\partial v}} \right\}} = 0}}} & (25) \end{matrix}$

At this point, assume that the constraint cost function is a quadratic function in u and v. This assumption is made to arrive at a linear matrix equation for optimal motion parameter estimation. Although any differentiable cost function would be acceptable, the model parameter solution may otherwise require costly non-linear optimization techniques. In particular, the constraint cost function is in the form

φ(u,v)=ξ₁ +ξ ₂ u+ξ ₃ v+ξ ₄ uv+ξ ₅ u ²+ξ₆ v ².  (26)

Then, Equation (25) can be re-written as $\begin{matrix} {{\begin{bmatrix} {\sum\limits_{x,{y \in I}}\left( {I_{x}^{2} + {2\xi_{5}}} \right)} & {\sum\limits_{x,{y \in I}}\left( {{I_{x}I_{y}} + \xi_{4}} \right)} \\ {\sum\limits_{x,{y \in I}}\left( {{I_{x}I_{y}} + \xi_{4}} \right)} & {\sum\limits_{x,{y \in I}}\left( {I_{y}^{2} + {2\xi_{6}}} \right)} \end{bmatrix}\begin{bmatrix} u_{g} \\ v_{g} \end{bmatrix}} = \begin{bmatrix} {- {\sum\limits_{x,{y \in I}}\left( {{I_{x}I_{21}} + \xi_{2}} \right)}} \\ {- {\sum\limits_{x,{y \in I}}\left( {{I_{y}I_{21}} + \xi_{3}} \right)}} \end{bmatrix}} & (27) \end{matrix}$

The solution of this simple 2 by 2 matrix equation yields the optimal translational motion model parameters u_(g) and v_(g) under the given quadratic constraint cost function. Of particular importance is the cost function

φ(u,v)=(u−u _(c))²+(v−v _(c))²  (28)

where we know the expected translational parameters.

Intensity Changes

All methods above are derived under the premise that the intensity of a pixel does not change along the motion trajectory. As explained earlier, this may not always be true. The external illumination may change and the gain/offset of the image capture device may vary between captured frames. To take these effects into account, we modify Equation (10) such that

κ₁ I ₁(x ₁ ,y ₁)+κ₂ =I ₂(x ₂ ,y ₂)  (29)

From here, the optimization proceeds exactly as before, except that parameters κ₁ and κ₂ need to be estimated as well. We shall now derive the affine motion model parameter estimation equations under the assumption (29). Derivations for other motion models are not repeated since the outline of the derivation is very similar in each case.

Incorporating the affine motion model equations given by the Equation (19), into (29), we write:

κ₁ I ₁(x,y)+κ₂ =I ₂(x+a ₁ x+a ₂ y+a ₃ , y+a ₄ x+a ₅ y+a ₆)  (30)

From which Taylor Series expansion results in:

I _(x)(x,y)(xa ₁ +ya ₂ +a ₃)+I _(y)(x,y)(xa ₄ +ya ₅ +a ₆)+I ₂(x,y)−κ₁ I ₁(x,y)−κ₂≅0  (31)

To solve for the unknown parameters, define a cost function Ψ as below: $\begin{matrix} {\Psi = {\sum\limits_{x_{1},{y_{1} \in I}}\begin{Bmatrix} {{{I_{x}\left( {x,y} \right)}\left( {{xa}_{1} + {ya}_{2} + a_{3}} \right)} + {{I_{y}\left( {x,y} \right)}\left( {{xa}_{4} + {ya}_{5} + a_{6}} \right)} +} \\ {{I_{2}\left( {x,y} \right)} - {\kappa_{1}{I_{1}\left( {x,y} \right)}} - \kappa_{2}} \end{Bmatrix}^{2}}} & (32) \end{matrix}$

Now take the partial derivatives of Ψ with respect to the affine parameters a₁,a₂,a₃,a₄,a₅,a₆ and the illumination change model parameters κ₁,κ₂, and set them equal to zero. After carrying out the algebraic steps, we obtain, ${\begin{bmatrix} {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{- {xI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{- {yI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}I_{x}}} & {\sum\limits_{x,{y \in I}}{- I_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{- {xI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{- {yI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}I_{y}}} & {\sum\limits_{x,{y \in I}}{- I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{1}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{1}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{1}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{1}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{1}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{1}}} & {\sum\limits_{x,{y \in I}}{{- I_{1}}I_{1}}} & {\sum\limits_{x,{y \in I}}{{- 1}I_{1}}} \\ {\sum\limits_{x,{y \in I}}{xI}_{x}} & {\sum\limits_{x,{y \in I}}{yI}_{x}} & {\sum\limits_{x,{y \in I}}I_{x}} & {\sum\limits_{x,{y \in I}}{xI}_{y}} & {\sum\limits_{x,{y \in I}}{yI}_{y}} & {\sum\limits_{x,{y \in I}}I_{y}} & {\sum\limits_{x,{y \in I}}{- I_{1}}} & {\sum\limits_{x,{y \in I}}{- 1}} \end{bmatrix}\begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} a_{1} \\ a_{2} \end{matrix} \\ a_{3} \end{matrix} \\ a_{4} \end{matrix} \\ a_{5} \end{matrix} \\ a_{6} \end{matrix} \\ \kappa_{1} \end{matrix} \\ \kappa_{2} \end{bmatrix}} = \begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {- {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{2}}}} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{x}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{y}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{1}I_{2}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}I_{2}}} \end{bmatrix}$

Lens Distortion

Inexpensive lens systems introduce geometric distortion into the imaging system. This is shown in FIG. 2. Geometric distortion causes the point shown in undistorted first frame 210 to appear in a slightly different location in geometrically distorted image 220. This same distortion causes the apparent motion of this point in undistorted second frame 230 to appear instead at the position shown in distorted second frame 240.

In this section, we will develop methods of motion estimation between images captured with an imperfect lens that causes geometric distortions. The gamma factor and external illumination changes are also taken into account. A nonlinear optimization framework to solve for distortion parameters is introduced. Linearization of this model results in OFE-like equations.

The geometric lens distortions can be modeled as $\begin{matrix} {x_{g} = \frac{x}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}} & (33) \\ {y_{g} = \frac{y}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}} & (34) \end{matrix}$

where κ₇ is the lens geometric distortion parameter, (x_(g),y_(g)) are the distorted pixel positions and (x,y) are the corrected pixel positions.

Using Equation (33) and (34), we write $\begin{matrix} {{\frac{x_{g}}{y_{g}} = \frac{x}{y}},} & (35) \end{matrix}$

Putting Equation (35) into Equation (33) yields $\begin{matrix} {{{y^{2}\left\lbrack {\kappa_{7}\left( {\frac{x_{g}^{2}}{y_{g}^{2}} + 1} \right)} \right\rbrack} + {y\left( {- \frac{1}{y_{g}}} \right)} + 1} = 0} & (36) \end{matrix}$

There are two solutions to this quadratic equation: $\begin{matrix} {{y = {\frac{1 \pm \sqrt{1 - {4\quad {\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}}}{2\quad {\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}y_{g}}},\quad {x = {y\frac{x_{g}}{y_{g}}}}} & (37) \end{matrix}$

As κ₇ goes to 0, y should approach y_(g). Since, ${{\lim\limits_{\kappa_{7}\rightarrow 0}{\left\{ \frac{1 + \sqrt{1 - {4{\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}}}{2{\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}\quad \right\} y_{g}}} = \infty},$

this can not be a solution. On the other hand, the second solution satisfies this requirement, hence it is the true solution. ${\lim\limits_{\kappa_{7}\rightarrow 0}\quad {\frac{1 - \sqrt{1 - {4{\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}}}{2{\kappa_{7}\left( {x_{g}^{2} + y_{g}^{2}} \right)}}\quad y_{g}}} = y_{g}$

There are many parametric motion models that map pixels from one frame to another. The affine model is used for subsequent derivation in this section. The translational, bilinear, and perspective motion models follow exactly the same procedure, and are therefore not treated for the sake of space.

Using the geometric distortion model given by Equation (33), we write $\begin{matrix} {x_{g}^{\prime} = {{\left( {\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4},\kappa_{5},\kappa_{6},\kappa_{7},x_{g},y_{g}} \right)} = \frac{x^{\prime}}{1 + {\kappa_{7}\left( {x^{\prime 2} + y^{\prime 2}} \right)}}}} & (38) \end{matrix}$

$\begin{matrix} {y_{g}^{\prime} = {{\left( {\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4},\kappa_{5},\kappa_{6},\kappa_{7},x_{g},y_{g}} \right)} = \frac{y^{\prime}}{1 + {\kappa_{7}\left( {x^{\prime 2} + y^{\prime 2}} \right)}}}} & (39) \end{matrix}$

where

y′=κ ₄ x(x _(g) ,y _(g))+κ₂ y(x _(g) ,y _(g))+κ₂ y(x _(g) ,y _(g))+κ₃ y=κ ₄ x(x _(g) ,y _(g))+κ₅ y(x _(g) ,y _(g))+κ₆  (40)

where x(x_(g),y_(g)) and y(x_(g),y_(g)) are as given by Equation (37).

Therefore, we have a nonlinear mapping from one frame to another characterized by 7 parameters. With the assumption that intensity does not change along the motion trajectory, we write:

I ₁(x _(g) ,y _(g))=I ₂(x′ _(g) ,y′ _(g))  (41).

Nonlinear Geometric Correction

We can define a cost function given by $\begin{matrix} {\Psi = {\sum\limits_{x_{g},{y_{g} \in I_{1}}}\quad {\left( {{I_{1}\left( {x_{g},y_{g}} \right)} - {I_{2}\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}} \right)^{2}.}}} & (42) \end{matrix}$

This is a function of the affine and lens-distortion parameters,

k=(κ₁,κ₂,κ₃,κ₄, κ₅,κ₆,κ₇)

A variant of Powell's method for multivariable nonlinear optimization is used to find the parameters that minimize the cost function. Other multivariable nonlinear optimization methods known in the art may also be used. To speed up the calculation, rather than summing over all x_(g),y_(g) ε I₁, summation over several small rectangular regions in the image may be performed. The algorithm's performance depends on the size, location, and number of regions used. The accuracy of the estimate may be improved by choosing regions with features such as corners, rather than uniform regions, and by choosing regions towards the periphery of the image (where warping is more pronounced). Nonlinear optimization methods also benefit from a good initial guess. The affine-motion estimation method is used on the middle portions of the images (where the warping is relatively mild) for initial estimates of the affine parameters.

The widely used lens distortion model given by x_(g)=x(1+κ₇(x²+y²)) is not only a cruder approximation of the physics of the lens, but also give rise to more complicated equations, which requires the calculation of roots of a cubic polynomial.

A hybrid system that alternates between the affine-motion estimation method to estimate the six affine motion parameters, and a one-dimensional nonlinear optimization technique to estimate the lens-distortion parameter is used for optimization. For the one-dimensional optimization, the “Golden Search” method is used to minimize the cost function Ψ, here considered as a function of the single parameter κ₇ with the affine parameters (κ₁,κ₂,κ₃,κ₄,κ₅,κ₆) clamped.

Linearization in Geometric Correction

We may also use a Taylor Series approximation to get a set of linear equations with a closed-form solution. This process is shown in FIG. 3. Once the nonlinear model is selected 310, giving a system of nonlinear equations, an initial set of parameters is selected 320. Given the set of parameters, the system of nonlinear equations is linearized around the set of parameters 330, resulting in a linear system. This linear system of equations is solved 340 using standard techniques to reach a new set of parameters. The process of linearizing the system of nonlinear equations around the set of parameters and resolving the resulting linear solution is iterated 350 until our convergence criteria is met, or for a set number of steps. The linearization 330 is done as shown previously by Taylor Series expansion. If we were to center the Taylor Series around the parameter set k_(def)=(1,0,0,0,1,0,0) as we have done in previous sections, we would get no information about the lens-distortion parameter κ₇, since. ${\frac{\partial}{\partial\kappa_{7}}}_{k_{def}} = {{0\quad {and}\quad {\quad \frac{\partial}{\partial\kappa_{7}}}_{k_{def}}} = 0.}$

This is expected, since k_(def)=(1,0,0,0,1,0,0) induces zero motion, and with no motion, both images are the same, so we have no hope of recovering the lens-distortion parameter. Likewise, a Taylor Series approximation around a parameter-set corresponding to rotation around the center of the image provides no information on the lens distortion, as the distortion is radial. But other affine-parameter sets (κ₁,κ₂,κ₃,κ₄,κ₅,κ₆) yield an observable system for the lens-distortion parameter. More precisely, a Taylor Series approximation of I₂(x′_(g),y′_(g)) around the parameters K_(w)=(κ₁,κ₂,κ₃,κ₄,κ₅,κ₆, 0) would yield $\begin{matrix} {{I_{2}\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)} = {{I_{2}\left( {x_{g},y_{g}} \right)} + {\sum\limits_{i = 1}^{7}{{\frac{\partial I_{2}}{\partial x}\frac{\partial}{\partial\kappa_{i}}}}_{k_{w}}} + {\sum\limits_{i = 1}^{7}{{\frac{\partial I_{2}}{\partial y}\frac{\partial}{\partial\kappa_{i}}}}_{k_{w}}}}} & (43) \end{matrix}$

where $\begin{matrix} {{\frac{\partial}{\partial\kappa_{1}}}_{k_{w}} = x_{g}} & {{\frac{\partial}{\partial\kappa_{2}}}_{k_{w}} = y_{g}} & {{\frac{\partial}{\partial\kappa_{2}}}_{k_{w}} = 1} \\ {{\frac{\partial}{\partial\kappa_{4}}}_{k_{w}} = 0} & {{\frac{\partial}{\partial\kappa_{5}}}_{k_{w}} = 0} & {{\frac{\partial}{\partial\kappa_{6}}}_{k_{w}} = 0} \end{matrix}$ $\begin{matrix} {{\frac{\partial}{\partial\kappa_{7}}}_{k_{w}} = \quad {{\left( {{- k_{1}^{3}} + k_{1} - {k_{1}k_{4}^{2}}} \right)x_{g}^{3}} +}} \\ {\quad {{\left( {{{- 2}k_{1}k_{4}k_{5}} - {3k_{1}^{2}k_{2}} - {k_{2}k_{4}^{2}} + k_{2}} \right)x_{g}^{2}y_{g}} +}} \\ {\quad {{\left( {{{- 3}k_{1}k_{2}^{2}} + k_{1} - {2k_{2}k_{4}k_{5}} - {k_{1}k_{5}^{2}}} \right)x_{g}y_{g}^{2}} +}} \\ {\quad {{\left( {{- k_{2}^{3}} + k_{2} - {k_{2}k_{5}^{2}}} \right)y_{g}^{3}} + {\left( {{{- 3}k_{1}^{2}k_{3}} - {2k_{1}k_{4}k_{6}} - {k_{3}k_{4}^{2}}} \right)x_{g}^{2}} +}} \\ {\quad {{\left( {{{- 6}k_{1}k_{2}k_{3}} - {2k_{2}k_{4}k_{6}} - {2k_{3}k_{4}k_{5}} - {2k_{1}k_{5}k_{6}}} \right)x_{g}y_{g}} +}} \\ {\quad {{\left( {{{- 2}k_{2}k_{5}k_{6}} - {k_{3}k_{5}^{2}} - {3k_{2}^{2}\quad k_{3}}} \right)y_{g}^{2}} +}} \\ {\quad {{\left( {{{- 3}k_{1}k_{3}^{2}} - {k_{1}k_{6}^{2}} - {2k_{3}k_{4}k_{6}}} \right)x_{g}} +}} \\ {\quad {{\left( {{{- k_{2}}k_{6}^{2}} - {3k_{2}k_{3}^{2}} - {2k_{3}k_{5}k_{6}}} \right)y_{g}} + \left( {{- k_{3}^{3}} - {k_{3}k_{6}^{2}}} \right)}} \end{matrix}$ $\begin{matrix} {{\frac{\partial}{\partial\kappa_{1}}}_{k_{w}} = 0} & {{\frac{\partial}{\partial\kappa_{2}}}_{k_{w}} = 0} & {{\frac{\partial}{\partial\kappa_{2}}}_{k_{w}} = 0} \\ {{\frac{\partial}{\partial\kappa_{4}}}_{k_{w}} = x_{g}} & {{\frac{\partial}{\partial\kappa_{5}}}_{k_{w}} = y_{g}} & {{\frac{\partial}{\partial\kappa_{6}}}_{k_{w}} = 1} \end{matrix}$ $\begin{matrix} {{\frac{\partial}{\partial\kappa_{7}}}_{k_{w}} = \quad {{\left( {{{- k_{4}}k_{1}^{2}} - k_{4}^{3} + k_{4}} \right)x_{g}^{3}} +}} \\ {\quad {{\left( {{{- k_{5}}k_{1}^{2}} - {3k_{4}^{2}k_{5}} - {2k_{4}k_{1}k_{2}} + k_{5}} \right)x_{g}^{2}y_{g}} +}} \\ {\quad {{\left( {{{- 2}k_{5}k_{1}k_{2}} + k_{4} - {k_{4}k_{2}^{2}} - {3k_{4}k_{5}^{2}}} \right)x_{g}y_{g}^{2}} +}} \\ {\quad {{\left( {{{- k_{5}}k_{2}^{2}} - k_{5}^{3} + k_{5}} \right)y_{g}^{3}} + {\left( {{{- k_{6}}k_{1}^{2}} - {3k_{4}^{2}k_{6}} - {2k_{4}k_{1}k_{3}}} \right)x_{g}^{2}} +}} \\ {\quad {{\left( {{{- 6}k_{4}k_{6}k_{5}} - {2k_{4}k_{3}k_{2}} - {2k_{5}k_{1}k_{3}} - {2k_{6}k_{1}k_{2}}} \right)x_{g}y_{g}} +}} \\ {\quad {{\left( {{{- 2}k_{5}k_{3}k_{2}} - {k_{6}k_{2}^{2}} - {3k_{6}k_{5}^{2}}} \right)y_{g}^{2}} +}} \\ {\quad {{\left( {{{- 2}k_{6}k_{1}k_{3}} - {3k_{4}k_{6}^{2}} - {k_{4}k_{3}^{2}}} \right)x_{g}} +}} \\ {\quad {{\left( {{{- 3}k_{6}^{2}k_{5}} - {2k_{6}k_{3}k_{2}} - {k_{5}k_{3}^{2}}} \right)y_{g}} + \left( {{- k_{6}^{3}} - {k_{6}k_{3}^{2}}} \right)}} \end{matrix}$

The method described earlier is used for an initial estimate of the affine parameters, which are then used as the center of the Taylor series expansion. If the initial estimate is almost entirely translational, one may expand the Taylor series around just the translational component of the initial estimate to simplify the computations, taking k_(w)=(1,0,κ₃, 0,1,κ₆,0). This gives ${{\frac{\partial}{\partial\kappa_{7}}}}_{k_{w}} = {{{{–3k}_{3}x_{g}^{2}} - {2k_{6}x_{g}y_{g}} - {k_{3}y_{g}^{2}} - {\left( {k_{6}^{2} + {3k_{3}^{2}}} \right)x_{g}} - {2k_{3}k_{6}y_{g}} - {\left( {{- k_{3}^{3}} + {k_{3}k_{6}^{2}}} \right){and}{\frac{\partial}{\partial\kappa_{7}}}_{k_{w}}}} = {{{- k_{6}}x_{g}^{2}} - {2k_{3}x_{g}y_{g}} - {3k_{6}y_{g}^{2}} - {2k_{6}k_{3}x_{g}} - {\left( {{3k_{6}^{2}} + k_{3}^{2}} \right)y_{g}} - \left( {k_{6}^{3} + {k_{6}k_{3}^{2}}} \right)}}$

but may give inaccurate results if there is a substantial non-translational aspect to the motion.

Substituting Equation (43) into Equation (42), and taking the derivatives and setting them equal to zero yields the following linear matrix equation: ${\left\lbrack \quad \begin{matrix} {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {xI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {yI}_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{x}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{x}}} & {\sum\limits_{x,{y \in I}}{\mu \quad I_{x}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{xI}_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {xI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}{yI}_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad {yI}_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{x}I_{y}}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{I_{y}I_{y}}} & {\sum\limits_{x,{y \in I}}{\mu \quad I_{y}}} \\ {\sum\limits_{x,{y \in I}}{{xI}_{x}\mu}} & {\sum\limits_{x,{y \in I}}{{yI}_{x}\mu}} & {\sum\limits_{x,{y \in I}}{I_{x}\mu}} & {\sum\limits_{x,{y \in I}}{{xI}_{y}\mu}} & {\sum\limits_{x,{y \in I}}{{yI}_{y}\mu}} & {\sum\limits_{x,{y \in I}}{I_{y}\mu}} & {\sum\limits_{x,{y \in I}}{\mu\mu}} \end{matrix}\quad \right\rbrack\left\lbrack \quad \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {\Delta \quad k_{1}} \\ {\Delta \quad k_{2}} \end{matrix} \\ {\Delta \quad k_{3}} \end{matrix} \\ {\Delta \quad k_{4}} \end{matrix} \\ {\Delta \quad k_{5}} \end{matrix} \\ {\Delta \quad k_{6}} \end{matrix} \\ {\Delta \quad k_{7}} \end{matrix}\quad \right\rbrack} = \begin{bmatrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} {- {\sum\limits_{x,{y \in I}}{{xI}_{x}I_{w}}}} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{x}I_{w}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{x}I_{w}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{xI}_{y}I_{w}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{{yI}_{y}I_{w}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{I_{y}I_{w}}}} \end{matrix} \\ {- {\sum\limits_{x,{y \in I}}{\mu \quad I_{w}}}} \end{bmatrix}$

where ${{\mu = {{{{\frac{\partial}{\partial\kappa_{7}}}}_{k_{w}}I_{x}} + {\frac{\partial}{\partial\kappa_{7}}}}}}_{k_{w}}$

I_(y) and I_(w)=I₂(x,y)−I₁(x_(w),y_(w)), with x_(w) and y_(w) the images of x and y under the transformation given by k_(w)=(κ₁,κ₂,κ₃,κ₄,κ₅,κ₆,0).

Illumination Correction

With the incorporation of external illumination change and offset variation in capture devices as explained earlier, we modify Equation (41) as

κ₈ I ₁(x _(g) ,y _(g))+κ₉ =I ₂(x′ _(g) y′ _(g)),  (44)

and we redefine the cost function in terms of motion, lens distortion, and illumination change parameters as: $\begin{matrix} {\Psi = {\sum\limits_{x_{g},{y_{g} \in I_{1}}}\left( {{\kappa_{8}{I_{1}\left( {x_{g},y_{g}} \right)}} + \kappa_{9} - {I_{2}\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}} \right)^{2}}} & (45) \end{matrix}$

To account for vignetting effect, the vignetting correction function is introduced, and Equation (44) modified as $\begin{matrix} {\frac{{\kappa_{8}{I_{1}\left( {x_{g},y_{g}} \right)}} + \kappa_{9}}{W\left( {x_{g},y_{g}} \right)} = \frac{I_{2}\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}{W\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}} & (46) \end{matrix}$

where ${W\left( {x_{g},y_{g}} \right)} = {{\kappa_{10}{\cos^{4}\left( {\arctan\left( \frac{\sqrt{x_{w}^{2} + y_{w}^{2}}}{f} \right)} \right)}} + \left( {1 - \kappa_{10}} \right)}$

where f is the camera focal length, and (x_(w),y_(w)) is the camera imaging plane coordinates of the pixel (x_(g),y_(g)).

Then we can define a cost function in terms of (κ₁,κ₂, κ₃,κ₄, κ₅,κ₆,κ₇,κ₈,κ₉,κ₁₀) as $\begin{matrix} {\Psi = {\sum\limits_{x_{g},{y_{g} \in I_{1}}}\left( {\frac{{\kappa_{10}{I_{1}\left( {x_{g},y_{g}} \right)}} + \kappa_{11}}{W\left( {x_{g},y_{g}} \right)} - \frac{I_{2}\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}{W\left( {x_{g}^{\prime},y_{g}^{\prime}} \right)}} \right)^{2}}} & (47) \end{matrix}$

This cost function can again be minimized via non-linear optimization techniques, or we can perform Taylor Series approximation to arrive at a set of linear equations, which can easily be solved.

The foregoing detailed description of the present invention is provided for the purpose of illustration and is not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Accordingly the scope of the present invention is defined by the appended claims. 

What is claimed is:
 1. A method for correcting distortion in an imaging system, the method comprising: a) applying a motion estimation model to a first and a second image to generate a set of nonlinear equations representing distortion, wherein the motion estimation model accommodates a change in illumination along at least one motion trajectory between the first and second images; b) solving the set of nonlinear equations to produce a set of correction parameters; and c) correcting at least one of the first and second images using the correction parameters to remove distortion.
 2. The method of claim 1 where the distortion includes geometric lens distortion.
 3. The method of claim 2 wherein geometric lens distortion is modeled by the transform: $x_{g} = {{\frac{x}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}\quad y_{g}} = \frac{y}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}}$

where (x,y) are the corrected pixel locations, (x_(g),y_(g)) are distorted pixel locations, and κ₇ is a geometric lens distortion factor.
 4. The method of claim 1 wherein the correction parameters correct a change in illumination along the at least one motion trajectory.
 5. The method of claim 4 wherein illumination changes are modeled with a linear model.
 6. The method of claim 4 wherein illumination changes are modeled with a Vignetting model.
 7. The method of claim 1 where the method of solving the set of nonlinear equations is a multivariable nonlinear optimization method.
 8. The method of claim 1 wherein step b) further comprises: a) selecting an initial set of solution parameters; b) linearizing the set of nonlinear equations around the set of solution parameters; c) solving the resulting linearized set of equations to reach an updated set of solution parameters; and d) repeating steps b) and c) until a condition defined by a selected one of a finite number of iterations and a predetermined convergence criteria is met.
 9. The method of claim 8 where the set of nonlinear equations includes correction for geometric lens distortion.
 10. The method of claim 8 where the set of nonlinear equations includes correction for illumination changes.
 11. The method of claim 8 where the set of nonlinear equations includes correction for both geometric lens distortion and illumination changes.
 12. The method of claim 11 where the model for illumination changes is a linear model.
 13. The method of claim 11 where the model for illumination changes is a Vignetting model.
 14. The method of claim 11 wherein geometric lens distortion is modeled by the transform: $x_{g} = {{\frac{x}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}\quad y_{g}} = \frac{y}{1 + {\kappa_{7}\left( {x^{2} + y^{2}} \right)}}}$

where (x,y) are the corrected pixel locations, (x_(g),y_(g)) are distorted pixel locations, and κ₇ is the distortion factor.
 15. A computer storage medium having instructions stored therein for programming a computer to perform the method of claim
 11. 16. The method of claim 1 wherein step a) further comprises the step of performing motion estimation modeling using at least one of a translational motion model, an affine motion model, a bilinear motion model, and a perspective motion model. 